package de.koller.singularity.client.display;

import de.koller.aframe.plain.ADisplayPlain;
import de.koller.aframe.plain.IARootPlain;
import de.koller.oceanFramework.tree.Child;
import de.koller.singularity.SNode;
import de.koller.singularity.SRoot;
import java.awt.Graphics2D;

public class SDisplay extends SNode implements IARootPlain {

	public final ADisplayPlain plainDisplay = new ADisplayPlain( this, 1136, 640, SRoot.TITLE );
	@Child public final TileDisplay tileDisplay = new TileDisplay();
	
	@Override
	protected void init() {
		super.init();
		
		plainDisplay.init();
	}

	
	@Override
	protected void release() {
		super.release();
		
		plainDisplay.release();
	}

	@Override
	public void displayClosed() {
		sroot.stop();
	}

	@Override
	public void render( Graphics2D g ) {
		tileDisplay.renderTiles( g );
		
	}

	public void updateDisplay() {
		plainDisplay.render();
	}
	
	@Override
	public long getSystemTime() {
		return System.currentTimeMillis();
	}
	
	
	
}
